package jam.network.message;

import jam.model.*;
import jam.network.*;

import java.util.*;

public class ClientRequestGetChannelContacts extends ClientCommand {
	protected static final String KEYWORD = "CR_GETCCONTACTS";

	@Override
	public void process(ClientController controller) {
		ClientModel client = controller.getModel();
		LinkedList<String> contactList = new LinkedList<String>();
		boolean success = false;
		if(client.isLoggedIn()) {
			contactList = client.getUser().getChannelContacts();
			success = true;
		}
		controller.send(new ServerResponse(this,success,contactList));
	}

	@Override
	protected String getKeyword() {
		return ClientRequestGetChannelContacts.KEYWORD;
	}

	protected ClientRequestGetChannelContacts(int transactionId, Scanner args) {
		super(transactionId);
	}
}
